home *** CD-ROM | disk | FTP | other *** search
/ Aminet 39 / Aminet 39 (2000)(Schatztruhe)[!][Oct 2000].iso / Aminet / gfx / edit / PfPaint_V2.lha / PerfectPaint / rexx / bridge / ScaleWin.rx < prev    next >
Encoding:
Text File  |  2000-04-10  |  2.2 KB  |  170 lines

  1. /*     arexx Script 
  2.     Scale Window
  3. */
  4.  
  5.     options results
  6.     parse ARG Port Width Height Mode b
  7.     
  8.     ADDRESS value Port
  9.     pp_AvoidRefresh
  10.  
  11.     pp_GetWidth
  12.     W=result
  13.     pp_GetHeight
  14.     H=result
  15.  
  16.     pp_GetWidthB
  17.     Wb=result
  18.     IsBrush=0
  19.     IF Wb>0 then DO
  20.         IsBrush=1
  21.         pp_Bsave "perfectpaint:Temp/brush" 0 3
  22.     END
  23.  
  24.  
  25.     X2=W/2
  26.     Y2=H/2    
  27.     X=Width/2
  28.     Y=Height/2
  29.     X3=X-X2
  30.     Y3=Y-Y2
  31.  
  32.     pp_CountFrames
  33.     nb=result
  34.     IsAnim=0
  35.     if nb>1 then do
  36.         pp_SavePrefs 0 1 100 0 0
  37.         IsAnim=1
  38.         Do i=1 to nb
  39.             pp_GotoFrame i
  40.             pp_Save 'PerfectPaint:Temp/Anim'||i 0
  41.         END
  42.         pp_New Width Height
  43.         pp_MakeAnim nb 0
  44.         do i=1 to nb
  45.             pp_Bload 'PerfectPaint:Temp/Anim'||i
  46.  
  47.             IF Mode=0 then DO
  48.                 pp_Plot X2 Y2
  49.             END
  50.  
  51.             IF Mode=10 then DO
  52.                 pp_Plot X Y2
  53.             END    
  54.  
  55.             IF Mode=20 then DO
  56.                 pp_Plot X+X3 Y2
  57.             END
  58.  
  59.             IF Mode=3 then DO
  60.                 pp_Plot X2 Y
  61.             END
  62.  
  63.             IF Mode=13 then DO
  64.                 pp_Plot X Y
  65.             END
  66.  
  67.             IF Mode=23 then DO
  68.                 pp_Plot X+X3 Y
  69.             END
  70.  
  71.             IF Mode=6 then DO
  72.                 pp_Plot X2 Y+Y3
  73.             END
  74.  
  75.             IF Mode=16 then DO
  76.                 pp_Plot X Y+Y3
  77.             END
  78.  
  79.             IF Mode=26 then DO
  80.                 pp_Plot X+X3 Y+Y3
  81.             END
  82.         
  83.             pp_NextFrame
  84.  
  85.         END
  86.         pp_FreeBrush
  87.         IF IsBrush=1 then DO
  88.             pp_Bload "perfectpaint:Temp/brush"
  89.         END        
  90.         pp_PermitRefresh
  91.         ADDRESS COMMAND    'delete >nil: PerfectPaint:Temp/?#.*'
  92.         EXIT
  93.     END
  94.  
  95.     X2=W/2
  96.     Y2=H/2    
  97.     X=Width/2
  98.     Y=Height/2
  99.     X3=X-X2
  100.     Y3=Y-Y2
  101.     
  102.     pp_asay 'Please*wait*...'        
  103.     pp_PickBrush 0 0 W H
  104.  
  105.     pp_GetWidthB
  106.     IF result=0 then DO
  107.         pp_CloseAsay
  108.         pp_Warn 'Not*enough*memory.'        
  109.         IF IsBrush=1 then DO
  110.             pp_Bload "perfectpaint:Temp/brush"
  111.         END        
  112.         pp_PermitRefresh
  113.         ADDRESS COMMAND    'delete >nil: PerfectPaint:Temp/?#.*'
  114.     END    
  115.  
  116.     pp_New Width Height
  117.     pp_CloseAsay
  118.  
  119.     pp_asay 'Please*wait*...'
  120.  
  121.     IF Mode=0 then DO
  122.         pp_Plot X2 Y2
  123.     END
  124.  
  125.     IF Mode=10 then DO
  126.         pp_Plot X Y2
  127.     END    
  128.  
  129.     IF Mode=20 then DO
  130.         pp_Plot X+X3 Y2
  131.     END
  132.  
  133.     IF Mode=3 then DO
  134.         pp_Plot X2 Y
  135.     END
  136.  
  137.     IF Mode=13 then DO
  138.         pp_Plot X Y
  139.     END
  140.  
  141.     IF Mode=23 then DO
  142.         pp_Plot X+X3 Y
  143.     END
  144.  
  145.     IF Mode=6 then DO
  146.         pp_Plot X2 Y+Y3
  147.     END
  148.  
  149.     IF Mode=16 then DO
  150.         pp_Plot X Y+Y3
  151.     END
  152.  
  153.     IF Mode=26 then DO
  154.         pp_Plot X+X3 Y+Y3
  155.     END
  156.  
  157.     pp_FreeBrush
  158.     pp_CloseAsay    
  159.  
  160.     IF IsBrush=1 then DO
  161.         pp_Bload "perfectpaint:Temp/brush"
  162.     END
  163.  
  164.     pp_PermitRefresh
  165.     ADDRESS COMMAND    'delete >nil: PerfectPaint:Temp/?#.*'
  166.  
  167.     
  168.  
  169.  
  170.